<article>
    <header>
        <h1>Noticias</h1>
        <p>Noticias varias de remeras</p>
    </header>

    <a href="/index/agregar/">Agregar</a>

    <table>
        <tr>
            <td>Titulo</td>
            <td>Fecha</td>
            <td></td>
            <td></td>
            <td></td>
        </tr>

        <?php if (count($this->paginator)) : ?>
            <?php foreach ($this->paginator as $post) : ?>
                <tr>
                    <td><?php echo $post->title; ?></td>
                    <td><?php echo $post->created_at; ?></td>
                    <td><a href="/index/update/id/<?php echo $post->id ?>">Editar</a></td>
                    <td><a href="/index/delete/id/<?php echo $post->id ?>">Borrar</a></td>
                    <td><a href="/index/ver/id/<?php echo $post->id ?>">Ver</a></td>
                </tr>

            <?php endforeach; ?>

        <?php else : ?>
            <tr><td colspan="3">No hay datos</td></tr>

        <?php endif; 
        
        if(count($this->paginator)):
            echo $this->paginator;
        endif;
?>
            
            

    </table>
</article>